<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>短信项目视图</title>
    <link href="../../layui/css/layui.css" rel="stylesheet" type="text/css">
    <link href="../../css/style.css" rel="stylesheet" type="text/css">
    <script src="../../layui/layui.js"></script>
    <link href="../../layui/css/iconfont/iconfont.css" rel="stylesheet" type="text/css">
    <script src="../../layui/css/iconfont/iconfont.js"></script>
    <script src="../../js/jquery-1.8.3.js"></script>
    <script src="../../js/util.js"></script>
    <script type="text/javascript">
        layui.use(['table', 'form', 'jquery', 'element', 'layer'], function () {
            var element = layui.element;
            var layer = layui.layer;
            var form = layui.form;
            var url = '/smsMgrView/find';
            var $ = layui.$;
            $(document).ready(function () {
                $.ajax({
                    type: 'post',
                    async: false,
                    url: '/smsMgrView/stateCount',
                    success: function (json) {
                        data = json.data;
                        for (var i = 0; i < data.length; i++) {
                            var content = "<br>在发:" +
                                data[i].runNum +
                                "  暂停:" +
                                data[i].waitNum +
                                "  停止:" +
                                data[i].stopNum;
                            var span = "#span" + data[i].cityId;
                            $(span).append(content);
                        }
                    }
                });
                $.ajax({
                    type: 'post',
                    async: false,
                    url: '/smsMgrView/stateCountAll',
                    success: function (json) {
                        data = json.data;
                        var content ="在发:" +
                            data[0].runNum +
                            "&nbsp;&nbsp;&nbsp;&nbsp;暂停:" +
                            data[0].waitNum +
                            "&nbsp;&nbsp;&nbsp;&nbsp;停止:" +
                            data[0].stopNum;
                        $("#count").html(content);
                    }
                });
                $.ajax({
                    type: 'post',
                    async: false,
                    url: url,
                    success: function (json) {
                        data = json.data;
                        var city2 = "";
                        for (var i = 0; i < data.length; i++) {
                            city2 += data[i].cityId;
                            city2 += ",";
                            var ul = ' <li>\n' +
                                '                                    <div class="layui-collapse">\n' +
                                '                                        <div class="layui-colla-item">\n' +
                                '                                            <h2 class="layui-colla-title">' +
                                data[i].name;

                            if (data[i].state == 0) {
                                ul += '<span class="status-working"></span>\n';
                            } else if (data[i].state == 1) {
                                ul += '<span class="status-waiting"></span>\n';
                            } else {
                                ul += '<span class="status-stopping"></span>\n';
                            }

                            ul += '</h2>\n <div class="layui-colla-content ">\n' +
                                '                                                <div class="index-time">开始: ' +
                                data[i].startTime +
                                '</div>\n' +
                                '                                                <div class="index-time">结束: ' +
                                data[i].endTime +
                                '</div>\n' +
                                '                                            </div>\n' +
                                '                                        </div>\n' +
                                '                                    </div>\n' +
                                '                                </li>';
                            var city = "#" + data[i].cityId;
                            $(city).append(ul);
                        }
                        element.init();
                        for (var j = 11; j <= 25; j++) {
                            var li = "#city" + j;
                            if (city2.indexOf(j) < 0) {
                                $(li).remove();
                            }
                        }
                    }, error: function () {
                        layer.msg('系统异常，请联系管理员处理!');
                    }
                });
            });

        });


    </script>
</head>
<body>
<!--nav-->
<div class="layui-html-limit">
    <!--container-->
    <div class="layui-content-body">
        <div class="scroll-box">
            <div class="breadcrumb-box">
              <span class="layui-breadcrumb" lay-separator="|">
                 <a href="javascript:returnIndex2()">首页&nbsp;</a>
                <a href="">&nbsp;报表管理&nbsp;</a>
                <a href="">&nbsp;短信项目视图&nbsp;</a>
              </span>
            </div>
            <div class="content-box full-height">
                <div class="index-tuli">
                    <span class="label-name">全省:</span>
                    <div class="item-tuli"><span class="index-name">在发</span><span class="status-working"></span></div>
                    <div class="item-tuli"><span class="index-name">暂停</span><span class="status-waiting"></span></div>
                    <div class="item-tuli"><span class="index-name">停止</span><span class="status-stopping"></span></div>
                    <div class="item-tuli"><span class="index-name" id="count"></span></div>
                </div>
                <div class="index-content">
                    <ul class="index-ul-wrap">
                        <li id="city11">
                            <span class="index-city" id="span11">苏州</span>
                            <ul class="index-inner-wrap" id="11">
                            </ul>
                        </li>

                        <li id="city12">
                            <span class="index-city" id="span12">淮安</span>
                            <ul class="index-inner-wrap" id="12">
                            </ul>
                        </li>

                        <li id="city13">
                            <span class="index-city" id="span13">宿迁</span>
                            <ul class="index-inner-wrap" id="13">
                            </ul>
                        </li>

                        <li id="city14">
                            <span class="index-city" id="span14">南京</span>
                            <ul class="index-inner-wrap" id="14">
                            </ul>
                        </li>

                        <li id="city15">
                            <span class="index-city" id="span15">连云港</span>
                            <ul class="index-inner-wrap" id="15">
                            </ul>
                        </li>

                        <li id="city16">
                            <span class="index-city" id="span16">徐州</span>
                            <ul class="index-inner-wrap" id="16">
                            </ul>
                        </li>

                        <li id="city17">
                            <span class="index-city" id="span17">常州</span>
                            <ul class="index-inner-wrap" id="17">
                            </ul>
                        </li>

                        <li id="city18">
                            <span class="index-city" id="span18">镇江</span>
                            <ul class="index-inner-wrap" id="18">
                            </ul>
                        </li>


                        <li id="city19">
                            <span class="index-city" id="span19">无锡</span>
                            <ul class="index-inner-wrap" id="19">
                            </ul>
                        </li>

                        <li id="city20">
                            <span class="index-city" id="span20">南通</span>
                            <ul class="index-inner-wrap" id="20">
                            </ul>
                        </li>

                        <li id="city21">
                            <span class="index-city" id="span21">泰州</span>
                            <ul class="index-inner-wrap" id="21">
                            </ul>
                        </li>

                        <li id="city22">
                            <span class="index-city" id="span22">盐城</span>
                            <ul class="index-inner-wrap" id="22">
                            </ul>
                        </li>

                        <li id="city23">
                            <span class="index-city" id="span23">扬州</span>
                            <ul class="index-inner-wrap" id="23">
                            </ul>
                        </li>
                        <li id="city25">
                            <span class="index-city" id="span25">省级项目</span>
                            <ul class="index-inner-wrap" id="25">
                            </ul>
                        </li>

                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>